﻿  //początek kodu z listingu 10.9
   function show()
  {
    if(!activeMenu) return;
    
    var height = krokY + parseInt(activeMenu.style.height);
    activeMenu.style.height = height + "px";

    if(offsetHeight > activeMenu.offsetHeight){
      timerId = setTimeout("show();", timeout);
    }
  }

  function closeMenu()
  {
    if(timerId){
      clearTimeout(timerId);
      timerId = null;
    }
    if(activeMenu){
      activeMenu.style.height = "";
      activeMenu.style.display = "none";
      activeMenu = null;
    }
  }
  function akcja(obj)
  {
    alert("Kliknięto pozycję '" + obj.innerHTML + "'.");
  }
  document.onclick = closeMenu;
</script>